package com.example.crm.controller;

import com.example.crm.service.CustomerCategoryService;
import com.example.crm.service.CustomerTagService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * 系统设置控制器
 */
@Controller
@RequestMapping("/settings")
public class SettingsController {

    @Autowired
    private CustomerCategoryService customerCategoryService;
    
    @Autowired
    private CustomerTagService customerTagService;

    /**
     * 系统设置首页
     */
    @GetMapping
    public String index() {
        return "settings/index";
    }
    
    /**
     * 客户分类设置页面
     */
    @GetMapping("/customer-categories")
    public String customerCategories(Model model) {
        model.addAttribute("categories", customerCategoryService.listAllCategories());
        return "settings/customer-categories";
    }
    
    /**
     * 客户标签设置页面
     */
    @GetMapping("/customer-tags")
    public String customerTags(Model model) {
        model.addAttribute("tags", customerTagService.listAllTags());
        return "settings/customer-tags";
    }
    
    /**
     * 用户管理页面
     */
    @GetMapping("/users")
    public String users() {
        return "settings/users";
    }
    
    /**
     * 角色管理页面
     */
    @GetMapping("/roles")
    public String roles() {
        return "settings/roles";
    }
} 